package lab3;

public class Lab2_3{
    public static void main(String args[]){
        String str= "This string "; //创建字符串对象str
        StringBuffer b_str=new StringBuffer();//创建字符串缓冲区对象b_str;
        System.out.println("长度为: "+b_str.length()+" 容量为:"+b_str.capacity());
        System.out.println(b_str. append(str)) ;
        System.out.println("长度为: "+b_str.length()+" 容量为:"+b_str.capacity());
        b_str.setCharAt(4,'#');
        System.out.println(b_str);
        System.out.println(b_str.reverse());
        System.out.println(b_str.reverse());
        System.out.println(b_str.insert (4, " is "));
    }
}

